#!/bin/bash
#--------------------------------------------------------------------------------------------------
#               二级菜单
#--------------------------------------------------------------------------------------------------
source ./var
source ./Install_nginx
source ./Install_jdk7
source ./Install_jdk8
source ./Install_mysql_source
source ./Install_mysql_bin
source ./Install_tomcat
source ./Install_maven
source ./Install_node
source ./Install_php
source ./Install_py3
source ./Install_zabbix_agent
source ./Install_redis
source ./Install_trash
source ./Install_vsftpd
source ./Install_LNMP
source ./Install_Docker
source ./Install_docker-compose
source ./LNMP_Configuration
source ./Install_zabbix_server
source ./Install_git
source ./Install_gitlab
#不知道这里为什么不用调用Entry_Menu_Bar，如果调用就是死循环
#source ./Entry_Menu_Bar
#source /root/autoinstall/Install_jdk8
Install(){
    OPTION=$(whiptail --title "运维-一键部署脚本" --menu "请选择想要安装的项目，上下键进行选择，回车即安装，左右键可选择<Cancel>返回上层！" 25 55 15 \
        "1" "nginx-1.18.0" \
        "2" "jdk-1.8" \
        "3" "tomcat-8" \
        "4" "mysql-source-5.6" \
        "5" "node-12" \
        "6" "maven-3.6" \
        "7" "php-7.3" \
        "8" "zabbix-agent-4.x" \
        "9" "py-3.8" \
        "10" "redis-5.0.8" \
        "11" "trash-autotrash" \
        "12" "jdk-1.7"  \
        "13" "mysql5.7-bin"  \
        "14" "vsftpd"  \
	    "15" "LNMP(1.14-7-5.7)"  \
	    "16" "Docker-18"  \
	    "17" "docker-compose(1.25.5)"  \
	    "18" "LNMP_Configuration"  \
	    "19" "zabbix-server-4.4"  \
        "20" "git-2.26.2"  \
	    "21" "gitlab-ce-12.8.9"  \
        "22" "暂时未定义"  3>&1 1>&2 2>&3  )
    case $OPTION in
    1)
        A && Install_nginx
        ;;
    2)
        A && Install_jdk8
        ;;
    3)
        A && tomcat
        ;;
    4)
        A && mysql_source
        ;;
    5)
        A && node
        ;;
    6)
        A && maven
        ;;
    7)
        A && php
        ;;
    8)
        A && zabbix_agent
        ;;
    9)
        A && py3
        ;;
    10)
        A && redis
        ;;
    11)
        A && trash && source /etc/bashrc
        ;;
    12)
        A && jdk7
        ;;
    13)
        A && mysql_bin
	;;
    14)
        A && Install_vsftpd
	;;
    15)
        A && Install_LNMP
	;;
    16)
        A && Install_Docker
	;;
    17)
        A && Install_docker-compose
	;;
    18)
        A && LNMP_Configuration
	;;
    19)
        A && Install_zabbix_server
	;;
    20)
        A && Install_Git
        ;;
    21)
        A && Install_gitlab
        ;;
    22)
        echo -e  "\e[36m ****您选择的安装项目暂时未定义！****\e[39m" && exit 1
        ;;
    *) 
        Entry_Menu_Bar
#        rm -rf $dir
        ;;
    esac
}

#Install
